#需求:小猫吃鱼，小猫喝水
#定义猫类
class cat():
    def __init__(self,name,*hooby):
        self.name=name
        self.hooby=hooby
    #定义喝水方法
    def drink(self,juice):
        print(f"{self.name}喝{juice}",end=",")
    #定义吃鱼方法
    def eat(self,food):
        print(f"{self.name}吃{food}")

    #str方法
    def __str__(self):
        return f"{self.name}的爱好是{self.hooby}"

if __name__ == '__main__':
    c=cat("小猫",*("睡觉","吃"))
    c.drink('水')
    c.eat('鱼')
    print(c)

